package com.x.factory;

import com.x.dao.BookDao;
import com.x.dao.impl.BookDaoImpl;
import org.springframework.beans.factory.FactoryBean;

/**
 * ClassName: BookDaoFactoryBean
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.08.31 22:50
 */
public class BookDaoFactoryBean implements FactoryBean<BookDao> {
    @Override
    public BookDao getObject() throws Exception {
        return new BookDaoImpl();
    }

    @Override
    public Class<?> getObjectType() {
        return BookDao.class;
    }

    //设置Bean为单例非单例
    @Override
    public boolean isSingleton() {
        return true;
    }
}
